package com.example.webapp.service.forum;

import java.util.List;

import org.hibernate.Session;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;

import com.example.webapp.hibernate.HibernateManager;

@Service
public class ForumService {
	private HibernateManager hibernateManager;
	
	public List<?> getForum() {
		Session session = hibernateManager.createSession();
		session.beginTransaction();
		List<?> result = session.createQuery("from Forum").list();
		
		return result;
	}
	
	@Required
	public void setHibernateManager(HibernateManager hibernateManager) {
		this.hibernateManager = hibernateManager;
	}
}
